package org.jeecg.modules.order.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.order.entity.BeienOrder;
import org.jeecg.modules.order.pojo.BeienOrderDetailInfo;
import org.jeecg.modules.order.service.IBeienOrderService;
import org.jeecg.modules.order.service.IBeienProcessDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@Api(tags="beien_order")
@RestController
@RequestMapping("/order/beienProcess")
@Slf4j
public class BeienProcessController {

    @Autowired
    private IBeienProcessDetailService detailService;


    /**
     * 分页列表查询
     *
     * @param beienOrder
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    //@AutoLog(value = "beien_order-分页列表查询")
    @ApiOperation(value="beien_order-分页列表查询", notes="beien_order-分页列表查询")
    @GetMapping(value = "/list")
    public Result<Page<BeienOrderDetailInfo>> queryPageList(BeienOrderDetailInfo beienOrder,
                                                            @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                                            @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                                            HttpServletRequest req) {

        Result<Page<BeienOrderDetailInfo>> result = new Result<>();
        Page<BeienOrderDetailInfo> pageList = new Page<>(pageNo, pageSize);
        pageList = detailService.getProcessDetailList(pageList,beienOrder);
        result.setSuccess(true);
        result.setResult(pageList);
        return result;
    }

}
